< previous page page_312 next page >

Page 312
Setting Up the Test Project
When you added the Standard EXE project to the group, you may have noticed that a grayed-out (dimmed) icon was added to your Toolbox. This icon represents your user control, and it remains disabled as long as you have the UserControl form open.
cbox.gif Close the UserControl window, and open the window for the default form from Project1. The Toolbox icon for your user control should be available, and hovering the mouse pointer over it displays the name of the sample control, AddressCtl, as shown in Figure 14.4.
0312-01.jpg
Figure 14.4
To make your ActiveX control
available to the project group,
close the UserControl window.
Now your custom ActiveX control is available. Go ahead and draw an instance on the form, just as you would with any other control. Notice that it appears just as you drew it on the UserControl, but it acts like a single control; all the text boxes within the control move together and cannot be selected individually.
At this point, your ActiveX control object is loaded and running, so try resizing the Address control on your form. As you change its size with the mouse, the code in the Resize event of the UserControl keeps the text boxes sized appropriately. If you try to reduce the height of the Address control too much, the control springs back to its minimum size, as pictured in Figure 14.5. You can, however, enlarge the control as much as you like.
0312-02.jpg
Figure 14.5
The test application shows the
Address  control set to its minimum width.

 
< previous page page_312 next page >